﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using VietKinsNutrition.Bussiness;

namespace VietKinsNutrition.UserControl
{
    public partial class UNhucaudinhduong : DevExpress.XtraEditors.XtraUserControl
    {
        ClsTblTruonghocBLL ClsTblTruonghocbll = new ClsTblTruonghocBLL();
        ClsTblDm_NhucaudinhduongotruongBLL ClsTblDm_Nhucaudinhduongotruongbll = new ClsTblDm_NhucaudinhduongotruongBLL();
        bool bVungmien = false;

        public UNhucaudinhduong()
        {
            InitializeComponent();
        }

        private void btnCapnhat_Click(object sender, EventArgs e)
        {
            ClsTblDm_Nhucaudinhduongotruongbll.DataBase(2, bVungmien, this.grdNhucauDD);
            ClsTblDm_Nhucaudinhduongotruongbll.LoadData(this.grdNhucauDD, bVungmien);
            ClsTblDm_Nhucaudinhduongotruongbll.j = 0;
        }

        private void UNhucaudinhduong_Load(object sender, EventArgs e)
        {
            try
            {
                bVungmien = bool.Parse(this.ClsTblTruonghocbll.ReturnTblTRuong().Rows[0]["Vungmien"].ToString());
            }
            catch
            {

            }
            ClsTblDm_Nhucaudinhduongotruongbll.DataBase(1, bVungmien, this.grdNhucauDD);
            ClsTblDm_Nhucaudinhduongotruongbll.LoadData(this.grdNhucauDD, bVungmien);
        }
    }
}
